<template>
	<view class="container">
		<!-- 个人信息 -->
		<view class="user-profile-container" @tap="PageToPersonalProfile">
			<view class="user-info">
				<view class="user-avatar">
					<image src="../../static/微信图片_20240805083439.jpg" mode=""></image>
				</view>
				<view class="user-name">
					<text style="font-size: 40rpx;margin-left: 15rpx;">卢薇薇</text>
				</view>
			</view>
			<view class="arrow-icon-wrapper">
				<view class="arrow-icon-container">
					<image src="../../static/右箭头 (1).png" mode=""></image>
				</view>
			</view>
		</view>
		<!-- 广子 -->
		<view class="ad-container">
			<view class="ad-content">
				<view class="ad-image-container">
					<image src="../../static/会员.png" mode=""></image>
				</view>
				<view class="ad-text-container">
					<text style="margin-left: 20rpx;font-size: 24rpx;">1元1天景区智慧导览</text>
				</view>
			</view>
			<view class="ad-action">
				<view class="action-text-container" @tap="pagetoVIP">
					<text style="font-size: 24rpx;">开通会员</text>
				</view>
				<view class="action-arrow-container">
					<image src="../../static/右箭头 (1).png" mode="aspectFit"></image>
				</view>
			</view>
		</view>
		<!-- 宫格 -->
		<view class="grid" style="margin-top: 30rpx;">
			<u-grid :border="false" col="3" @click="thepageto">
				<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="listItem.name" :size="22"></u-icon>
					<text class="grid-text">{{listItem.title}}</text>
				</u-grid-item>
			</u-grid>
			<u-toast ref="uToast" />
		</view>
		<!-- 单元格 -->
		<view class=""  style="width: 700rpx; margin: auto; margin-top: 30rpx;">
			<u-cell-group>
				<u-cell icon="file-text-fill" title="离线包管理" :isLink="true"></u-cell>
				<u-cell icon="error-circle-fill" title="建议反馈":isLink="true"></u-cell>
				<u-cell icon="server-fill" title="联系客服":isLink="true"></u-cell>
				<u-cell icon="setting-fill" title="设置":isLink="true"></u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						name: 'photo',
						title: '授权激活'
					},
					{
						name: 'lock',
						title: '我的权益'
					},
					{
						name: 'star',
						title: '我的订单'
					}
				]
			};
		},
		methods:{
			thepageto(name){
				if(name == 0){
					uni.navigateTo({
						url:'/pages/index/Authorization activation'
					})
				}else if(name ==1){
					uni.navigateTo({
						url:'/pages/index/My rights'
					})
				}
			},
			pagetoVIP(){
				uni.navigateTo({
					url:'/pages/index/VIP'
				})
			},
			PageToPersonalProfile(){
				uni.navigateTo({
					url:'/pages/index/PersonalProfile'
				})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		.grid-text {
			font-size: 14px;
			color: #909399;
			padding: 10rpx 0 20rpx 0rpx;
			/* #ifndef APP-PLUS */
			box-sizing: border-box;
			/* #endif */
		}

		.ad-container {
			.ad-action {
				.action-text-container {
					display: flex;
					align-items: center;
				}

				.action-arrow-container {
					image {
						width: 30rpx;
						height: 30rpx;
					}

					display: flex;
					align-items: center;
				}

				display: flex;
				align-items: center;
			}

			.ad-content {
				.ad-image-container {
					image {
						margin-left: 20rpx;
						width: 60rpx;
						height: 60rpx;
					}

					display: flex;
					align-items: center;
				}

				display: flex;
				align-items: center;
			}

			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: auto;
			margin-top: 20rpx;
			width: 700rpx;
			height: 100rpx;
			background-color: #f2f2f2;
			border-radius: 20rpx;
		}

		.arrow-icon-wrapper {
			.arrow-icon-container {
				image {
					width: 30rpx;
					height: 30rpx;
				}

				display: flex;
				align-items: center;
			}
		}

		.user-profile-container {
			margin-top: 20rpx;
			width: 700rpx;
			height: 200rpx;
			display: flex;
			align-items: center;

			.user-avatar {
				image {
					width: 120rpx;
					height: 120rpx;
					border-radius: 50px;
				}
			}

			.user-info {
				display: flex;
				align-items: center;
				margin-left: 10rpx;
			}

			margin: auto;
			display: flex;
			justify-content: space-between;
		}

		background-color: #fff;
		width: 100%;
		height: 100vh;
	}
</style>